// import { ChartView } from 'echarts'
import Vue from 'vue'
import VueRouter from 'vue-router'


const room =()=>import('../views/room.vue')//房间管理
const baoxiu =()=>import('../views/baoxiu.vue')//报修
const People =()=>import('../views/people.vue')//居民管理
const Login = () => import('../views/Login.vue')//登陆
const Home = () => import('../views/Home.vue')//全局首页
const About = () => import('../views/About.vue')//公告
const Page = () => import('../components/goods/Page.vue')//首页
const Center = () =>import('../components/goods/Center.vue')//投诉
const shop = () =>import('../views/shop.vue')//门店
const Item = () =>import('../components/goods/staffs.vue')
const Storied = () =>import('../views/Storied.vue')
const Administrator = ()=>import('../views/Administrator.vue')// 管理员

const Buildings = () =>import('../views/Building.vue')
const rooms = () =>import('../components/common/rooms.vue')
Vue.use(VueRouter)
const routes = [
  {
    path: '/',
    name: 'Login',
    component: Login
  },
  {
    path:'/login',
    name: 'login',
    component: Login,
  },
  {
    path: '/staffs',
    name: 'staffs',
    component:Item,
  },

  {
    path: '/Home',
    name: 'Home',
    component: Home,
    redirect: '/Page',
    children:[
    {
      path: '/baoxiu',
      name: 'Baoxiu',
      component: baoxiu
    },
    {
      path: '/people',
      name: 'People',
      component:People
    },{
      path: '/About',
      name: 'About',
      component:About
    },{
      path: '/page',
      name: 'Page',
      component:Page
    },
    {
      path: '/shop',
      name: 'shop',
      component: shop
    },
    {
      path: '/Center',
      name: 'Center',
      component:Center
    },
    {
      path: '/item',
      name: 'item',
      component:Item
    },
    {
      path: '/room',
      name: 'room',
      component:room
    },{
      path: '/storied',
      name: 'storied',
      component:Storied
    },
    {
      path: '/Administrator',
      name: 'Administrator',
      component: Administrator
    },
    {
      path:'/rooms',
      name: 'rooms',
      component: rooms,
    },
    {
      path: '/buildings',
      name: 'buildings',
      component:Buildings
    }
  ]},
]
    
const router = new VueRouter({
  name:'history',
  base:process.BASE_URL,
  routes
  
})

export default router
